package com.yipingnai.blog.model;

import com.fasterxml.jackson.annotation.JsonFormat;

import java.sql.Timestamp;
import java.util.Arrays;
import java.util.List;

/**
 * @Author: jiangym
 * @Date: 2020/4/11 13:52
 */
public class Article {
    private Long id;
    private String title;
    private String mdContent;
    private String htmlContent;
    private String summary;
    private Long cid;
    private Long uid;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Timestamp publishDate;
    private String articleImg;
    private Integer state;
    private Integer pageView;
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Timestamp editTime;
    private User user;
    private Category category;
    private List<Tags> tags;
    private String[] dynamicTags;

    public Article() {
    }

    public String[] getDynamicTags() {
        return dynamicTags;
    }

    public void setDynamicTags(String[] dynamicTags) {
        this.dynamicTags = dynamicTags;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getMdContent() {
        return mdContent;
    }

    public void setMdContent(String mdContent) {
        this.mdContent = mdContent;
    }

    public String getHtmlContent() {
        return htmlContent;
    }

    public void setHtmlContent(String htmlContent) {
        this.htmlContent = htmlContent;
    }

    public String getSummary() {
        return summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public Long getCid() {
        return cid;
    }

    public void setCid(Long cid) {
        this.cid = cid;
    }

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public Timestamp getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(Timestamp publishDate) {
        this.publishDate = publishDate;
    }

    public String getArticleImg() {
        return articleImg;
    }

    public void setArticleImg(String articleImg) {
        this.articleImg = articleImg;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getPageView() {
        return pageView;
    }

    public void setPageView(Integer pageView) {
        this.pageView = pageView;
    }

    public Timestamp getEditTime() {
        return editTime;
    }

    public void setEditTime(Timestamp editTime) {
        this.editTime = editTime;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public List<Tags> getTags() {
        return tags;
    }

    public void setTags(List<Tags> tags) {
        this.tags = tags;
    }

    @Override
    public String toString() {
        return "Article{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", mdContent='" + mdContent + '\'' +
                ", htmlContent='" + htmlContent + '\'' +
                ", summary='" + summary + '\'' +
                ", cid=" + cid +
                ", uid=" + uid +
                ", publishDate=" + publishDate +
                ", articleImg='" + articleImg + '\'' +
                ", state=" + state +
                ", pageView=" + pageView +
                ", editTime=" + editTime +
                ", user=" + user +
                ", category=" + category +
                ", tags=" + tags +
                ", dynamicTags=" + Arrays.toString(dynamicTags) +
                '}';
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Article(Long id, String title, String mdContent, String htmlContent, String summary, Long cid, Long uid, Timestamp publishDate, String articleImg, Integer state, Integer pageView, Timestamp editTime, User user, Category category, List<Tags> tags, String[] dynamicTags) {
        this.id = id;
        this.title = title;
        this.mdContent = mdContent;
        this.htmlContent = htmlContent;
        this.summary = summary;
        this.cid = cid;
        this.uid = uid;
        this.publishDate = publishDate;
        this.articleImg = articleImg;
        this.state = state;
        this.pageView = pageView;
        this.editTime = editTime;
        this.user = user;
        this.category = category;
        this.tags = tags;
        this.dynamicTags = dynamicTags;
    }
}
